/*
 * =====================================================================================
 *
 *       Filename:  current.h
 *
 *    Description:  this file define a very important constant current.
 *    current is the pointer point to the current task.its implementation
 *    is very interesting.
 *
 *        Version:  1.0
 *        Created:  2011年02月24日 21时15分42秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  lonelydragon1988@gmail.com 
 *        Company:  
 *
 * =====================================================================================
 */
/*
 * i do not know how this function work,especially the 8191UL.
 * mybe it does not work. i will test it.
 */

static inline struct task_struct *get_current(void)
{
	struct task_struct *current;
	__asm__("andl %%esp,%0;" :"=r"(current) :"~8191UL");
	return current;
}

#define current get_current()
